package com.wxy.demo.aba;

import java.util.concurrent.atomic.AtomicReference;

public class Demo1 {
    public static void main(String[] args) {
        //创建一个Integer类型的原子引用atomicReference
        AtomicReference<Integer> atomicReference = new AtomicReference<>(100);
        //执行CAS操作
        atomicReference.compareAndSet(100, 101);
        System.out.println("当前实际值：" + atomicReference.get());
    }
}
